﻿<!--
 Peter
 Created by: Peter Development Team
    http://peter.codeplex.com/
 
 GNU General Public License version 2 (GPLv2)
    http://peter.codeplex.com/license
-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:Peter.Common.Controls">

   <!-- Control Templates for Numeric Spinner Control-->
   <Style TargetType="{x:Type controls:NumericUpDown}">
      <Setter Property="Height"
              Value="25" />
      <Setter Property="Template">

         <Setter.Value>
            <ControlTemplate TargetType="{x:Type controls:NumericUpDown}">
               <Border BorderBrush="{TemplateBinding BorderBrush}"
                       BorderThickness="{TemplateBinding BorderThickness}"
                       Height="{TemplateBinding Height}"
                       Width="{TemplateBinding Width}">
                  <DockPanel>
                     <UniformGrid Margin="0 1 0 1"
                                  Width="30"
                                  DockPanel.Dock="Right"
                                  Columns="1">

                        <!-- Increment Button -->
                        <RepeatButton x:Name="PART_IncrementButton">
                           <RepeatButton.Content>
                              <Viewbox Stretch="Uniform"
                                       Margin="0 1 0 0">

                                 <Path Stroke="{x:Static SystemColors.ControlTextBrush}"
                                       StrokeThickness="8"
                                       Data="M 0,0 L 15,15 L 30,0">
                                    <Path.RenderTransform>
                                       <RotateTransform CenterX="15"
                                                        CenterY="7.5"
                                                        Angle="180" />
                                    </Path.RenderTransform>
                                 </Path>
                              </Viewbox>
                           </RepeatButton.Content>
                        </RepeatButton>

                        <!-- Decrement Button -->
                        <RepeatButton x:Name="PART_DecrementButton">

                           <RepeatButton.Content>
                              <Viewbox Stretch="Uniform"
                                       Margin="0 1 0 0">
                                 <Path Stroke="{x:Static SystemColors.ControlTextBrush}"
                                       StrokeThickness="8"
                                       Data="M 0,0 L 15,15 L 30,0" />
                              </Viewbox>
                           </RepeatButton.Content>

                        </RepeatButton>
                     </UniformGrid>

                     <!-- TextBox -->
                     <TextBox x:Name="PART_NumericTextBox"
                              TextAlignment="Right"
                              VerticalContentAlignment="Center"
                              Margin="0 1 0 1"
                              DockPanel.Dock="Left" />
                  </DockPanel>
               </Border>
            </ControlTemplate>
         </Setter.Value>
      </Setter>
   </Style>

</ResourceDictionary>